<template>
	<view class="scroll-content">
		<view class="tab_nav">
			<view class="navTitle" v-for="(item,index) in navList" :key="index">
				<view :class="{'active':current === index}" @click="checked(index)">
					{{item.title}}
				</view>
			</view>
		</view>
		<!-- 直播邀约榜 -->
		<view class="nav_item" v-if="current==0">
			<view class="order-content" v-for="(item, index) in list" :key="item.id">
				<view>
					<!-- 序号 -->
					<!-- 前三 -->
					<!-- <view class="order"></view> -->
					<view class="order">{{ index + 1 }}</view>
					<!-- 头像 -->
					<view class="img">
						<image :src="item.pic" mode="widthFix"></image>
					</view>
					<!-- 昵称 -->
					<text>{{ item.name }}</text>
				</view>
				<!-- 邀约人数 -->
				<p>邀约<text>{{ item.number }}</text>人</p>

			</view>
		</view>

		<!-- 邀约明细 -->
		<view class="nav_item" v-if="current==1">
			<view class="detail-content">
				<view class="detail" v-for="(item2, id) in list2" :key="item2.id">
					<view>
						<image :src="item2.pic" mode="widthFix">
						</image>
					</view>
					<text>{{ item2.name }}</text>
					<text v-if="!item2.isInvitation">邀约</text>
					<button v-else>2022-03-04 14:21</button>

				</view>
			</view>
		</view>
		
		<!-- 弹出框 -->
	</view>
</template>

<script>
	export default {
		name: "live-scroll",
		data() {
			return {
				current: 0,
				navList: [{
					index: 0,
					title: '直播邀约榜'
				}, {
					index: 1,
					title: "邀约明细"
				}],
				// 假数据
				list: [{
						id: 1,
						pic: 'https://img.js.design/assets/img/5fcde8b32e35a164425da698.png',
						name: '自动',
						number: 11
					},
					{
						id: 2,
						pic: 'https://img.js.design/assets/img/5fcde8b32e35a164425da698.png',
						name: '自动2',
						number: 13
					},
					{
						id: 3,
						pic: 'https://img.js.design/assets/img/5fcde8b32e35a164425da698.png',
						name: '自动3',
						number: 12
					},
					{
						id: 4,
						pic: 'https://img.js.design/assets/img/5fcde8b32e35a164425da698.png',
						name: '自动',
						number: 5
					},
					{
						id: 5,
						pic: 'https://img.js.design/assets/img/5fcde8b32e35a164425da698.png',
						name: '自动',
						number: 20
					}
				],
				list2: [{
					id: 1,
					pic: 'https://img.js.design/assets/img/5fcde8b32e35a164425da698.png',
					name: '自动',
					isInvitation: true
				}, {
					id: 2,
					pic: 'https://img.js.design/assets/img/5fcde8b32e35a164425da698.png',
					name: '自动',
					isInvitation: false
				}, {
					id: 3,
					pic: 'https://img.js.design/assets/img/5fcde8b32e35a164425da698.png',
					name: '自动',
					isInvitation: true
				}, {
					id: 4,
					pic: 'https://img.js.design/assets/img/5fcde8b32e35a164425da698.png',
					name: '自动',
					isInvitation: false
				}]
			}
		},
		methods: {
			checked(index) {
				this.current = index
			},

		}
	}
</script>

<style lang="scss">
	.scroll-content {
		width: 100%;
		height: 684rpx;
		background-color: #ffffff;
		margin-top: 8rpx;
		// padding: 15px;
		font-family: "思源黑体";
		overflow: scroll;

		.scroll-view {
			display: flex;
			justify-content: space-between;
		}
	}

	.tab_nav {
		padding: 0 20rpx;
		display: flex;
		justify-content: space-around;
		align-items: center;
	}

	.tab_nav .navTitle {
		// height: 90rpx;
		line-height: 60rpx;
		text-align: center;
		font-size: 32rpx;
		color: #333;
	}

	.active {
		position: relative;
		color: #FF8800;
	}

	.active::after {
		content: "";
		position: absolute;
		width: 100%;
		height: 4rpx;
		background-color: #FF8800;
		left: 0px;
		right: 0px;
		bottom: 0px;
		margin: auto;
	}

	.nav_item {
		// padding-top: 10rpx;
		width: 700rpx;
		margin: 0 auto;

		// 直播邀约榜
		.order-content {
			display: flex;
			justify-content: space-between;
			align-items: center;
			border-bottom: 2rpx solid #EDEDED;
			height: 98rpx;
			padding-left: 10rpx;
			margin-top: 15rpx;
			font-size: 28rpx !important;

			&:first-child {
				margin-top: 30rpx;
			}

			>view {
				display: flex;
				align-items: center;
			}

			.order {
				font-size: 40rpx;
				width: 48rpx;
				height: 96rpx;
				text-align: center;
				line-height: 96rpx;
			}

			.img {
				width: 80rpx;
				height: 80rpx;
				border-radius: 50%;
				overflow: hidden;
			}

			>text {
				// margin-left: 20rpx;
			}

			>p,
			>text {
				font-size: 28rpx;
				color: #333333;
			}

			>p {
				text {
					margin: 0;
					padding: 0;
					color: #FE6161;
					font-size: 36rpx;
				}
			}
		}

		// 邀约明细
		.detail-content {
			display: flex;
			flex-wrap: wrap;

			.detail {
				display: flex;
				align-items: center;
				border-bottom: 2rpx solid #EDEDED;
				padding-bottom: 20rpx;
				width: 340rpx;
				margin-top: 10px;

				&:first-child {
					margin-top: 30rpx;
				}

				view {
					width: 80rpx;
					height: 80rpx;
					border-radius: 50%;
					overflow: hidden;
					margin-right: 10rpx;
				}

				text {
					font-size: 28rpx;
					color: #666666;

					&:last-child {
						font-size: 32rpx;
						color: #FF8800;
						margin-left: 72rpx;
					}
				}

				button {
					width: 140rpx;
					height: 38rpx;
					border-radius: 100px;
					border: 2rpx solid #CCCCCC;
					background-color: #ffffff;
					font-size: 14rpx;
					color: #CCCCCC;
				}
			}
		}

	}
</style>
